<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<c:set var="serviceurl" value="${ctx}/lease/contract" />
<div class="rap-page-area" >
	<div class="col-md-12 rap-layout-main">
		<!-- <div class="row rap-toolbar">
			<button id="rap-btn-close">
				<i class="fa fa-times"></i> 关闭
			</button>
		</div> -->
		<div class="row">
			<!-- Detail From -->
			<form id="rap-form-detail" class="rap-form rap-form-detail">
				<table>
					<tr>
						<td class="rap-form-lable ">合同编号</td>
						<td>
	<input name="contractNum" type="text" readonly="readonly">
						</td>
						<td class="rap-form-lable ">承租人</td>
						<td>
	<input type="text" name="custom.theName" readonly="readonly">
						</td>
						<td class="rap-form-lable ">签订日期</td>
						<td>
    <input name="signDate" type="text" readonly='readonly' /> 
						</td>
					</tr>
					<tr>
						<td class="rap-form-lable ">生效日期</td>
						<td>
    <input name="beginDate" type="text" readonly='readonly' /> 
						</td>
						<td class="rap-form-lable ">失效日期</td>
						<td>
    <input name="endDate" type="text" readonly='readonly' /> 
						</td>
					
						<td class="rap-form-lable ">租赁期限(月)</td>
						<td>
							<input name="months" type="number"  readonly="readonly">
						</td>
					</tr>
					<tr>
						<td class="rap-form-lable ">支付类型</td>
						<td>
    <select name="payType" class="rap-input-enumdata" data-enum-group="stwy_payType" disabled="disabled" ></select>
						</td>
						<td class="rap-form-lable ">租金</td>
						<td>
	<input name="rent" type="text"  readonly="readonly">
						</td>
						<td class="rap-form-lable ">租金单价</td>
						<td>
	<input name="price" type="text"  readonly="readonly">
						</td>
					</tr>
					<tr>
						<td class="rap-form-lable ">提前收租天数</td>
						<td>
	<input name="beforeDay" type="number"  readonly="readonly">
						</td>
						<td class="rap-form-lable ">租赁保证金</td>
						<td>
	<input name="deposit" type="text"  readonly="readonly">
						</td>
						<td class="rap-form-lable ">是否已备案</td>
						<td>
	<select name="hasArchives" class="rap-input-enumdata" data-enum-group="stwy_hasArchives" disabled="disabled"></select>
						</td>
					</tr>
					<tr>
						<td class="rap-form-lable">初次调租日期</td>
						<td>
    <input name="adjustDate" type="text" readonly='readonly' /> 
						</td>
						<td class="rap-form-lable">租金涨幅</td>
						<td>
							<div class="col-md-4 col-sm-4 rap-td-inline"><select name="increaseHandle" class="rap-input-enumdata" data-enum-group="stwy_increaseHandle" disabled="disabled"></select></div>
							<div class="col-md-6 col-sm-6 rap-td-inline"><input name="increase" type="text"  readonly="readonly"></div>
							<div class="col-md-2 col-sm-2 rap-td-inline"><select name="increaseType" class="rap-input-enumdata" data-enum-group="stwy_increaseType" disabled="disabled"></select></div>
						</td>
						<td class="rap-form-lable ">合同签订时是否缴纳租金</td>
						<td>
	<select name="hasInitPay" class="rap-input-enumdata" data-enum-group="BooleanType" disabled="disabled"></select>
						</td>
					</tr>
					<tr id="tr_initpay">
						<td class="rap-form-lable ">合同签订时支付租金</td>
						<td>
	<input name="initPay" type="text"  readonly="readonly">
						</td>
						<td class="rap-form-lable ">合同签订时租金缴至</td>
						<td>
	<input name="initPayEndDate" type="text" readonly='readonly' >
						</td>
						<td class="rap-form-lable">承租总面积(㎡)</td>
						<td>
	<input name="area" type="text" readonly="readonly">
						</td>
					</tr>
					<tr>
						<td class="rap-form-lable">政府指导价</td>
						<td>
	<input name="govPrice"  type="text"  readonly="readonly">
						</td>
						<td class="rap-form-lable">市场指导价</td>
						<td>
	<input name="marketPrice" type="text"  readonly="readonly">
						</td>
					</tr>
					<tr>
						<td class="rap-form-lable ">备注</td>
						<td colspan="5">
    <textarea name="remark" data-maxlength="300" maxlength="300" readonly="readonly"></textarea>
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</div>
<!-- 角色页面 -->
<%@include file="contract_assetlist.jsp"%>
<script>
function showData(data) {
	$("input[name='uuid']").val(data.uuid);
	$("input[name='theCode']").val(data.theCode);
	$("input[name='contractState']").val(data.contractState);
	$("input[name='contractChangeType']").val(data.contractChangeType);
	$("input[name='contractNum']").val(data.contractNum);
	$("input[name='customName']").val(data.custom.theName);
	$("input[name='custom.theName']").val(data.custom.theName);
	$("input[name='custom.uuid']").val(data.custom.uuid);
	$("input[name='beginDate']").val(data.beginDate);
	$("input[name='endDate']").val(data.endDate);
	
	$("input[name='signDate']").val(data.signDate);
	$("input[name='rent']").val(data.rent);
	$("select[name='increaseHandle']").val(data.increaseHandle);
	$("select[name='hasInitPay']").val(data.hasInitPay+"");
	$("input[name='area']").val(data.area);
	
	$("input[name='months']").val(data.months);
	$("select[name='payType']").val(data.payType);
	$("input[name='beforeDay']").val(data.beforeDay);
	$("input[name='price']").val(data.price);
	$("input[name='initPay']").val(data.initPay);
	$("input[name='initPayDate']").val(data.initPayDate);
	$("input[name='initPayEndDate']").val(data.initPayEndDate);
	$("select[name='increaseType']").val(data.increaseType);
	
	
	$("input[name='adjustDate']").val(data.adjustDate);
	$("input[name='increase']").val(data.increase);
	$("input[name='deposit']").val(data.deposit);
	$("select[name='hasArchives']").val(data.hasArchives);
	$("textarea[name='remark']").val(data.remark);
}
function getContractInfo(uuid){
	$.ajax({
		url : '${serviceurl}/query',
		data : {"search_EQ_uuid":uuid},
		dataType : 'json',
		success : function(data) {
			showData(data.records[0]);
		}
	});
}
$(document).ready(function() {
	var uuid = '${param.uuid}';
	getContractInfo(uuid);
	$("#rap-btn-close").click(function() {
		window.parent.$.colorbox.close();
	});
	_contractId = uuid;
	showAssetList('view');
	loadAssetList('view');
});
</script>